package training.oop.polymorphism;


public class PolyExample {
	
	public void sayHello(){
		System.out.println("Hello");
	}
	
	public void sayHello(String name){
		System.out.println("Hello " + name);
	}
	
	
	
	public void sayHello(String name, int hours){
		//int hours = Calendar.getInstance().getTime().getHours();
		
		StringBuilder builder = new StringBuilder();
		builder.append("Hello, ");
		builder.append( name);
		if(hours < 12){
			builder.append(", Good morning");
		}
		else if(hours > 12 && hours < 16){
			builder.append(", Good afternoon");
		}
		else{
			builder.append(", Good evening");
		}
		
		System.out.println(builder.toString());
	}
	
	
	public void sayHello(int hours){
		//int hours = Calendar.getInstance().getTime().getHours();
		
		StringBuilder builder = new StringBuilder();
		builder.append("Hello ");
		
		if(hours < 12){
			builder.append(", Good morning");
		}
		else if(hours > 12 && hours < 16){
			builder.append(", Good afternoon");
		}
		else{
			builder.append(", Good evening");
		}
		
		System.out.println(builder.toString());
	}
		
		


}
